<!-- 页面 -->
<template>
<div>
    <input type="text" v-model="person.name1"><br>
    <input type="text" v-model="person.name2"><br>
    <input type="text" v-model="person.aaa"><br>
</div>
</template>
<!--vue -->
<script>

import { reactive ,computed} from 'vue';
export default {
setup(){
    let person=reactive({
        name1:'张',
        name2:'松'
    })
    person.aaa=computed({
        get(){
            return person.name1+'-'+person.name2
        },
        set(val){
            let bbb = val.split("-")
            person.name1=bbb[0]
            person.name2=bbb[1]
        }
    })
    return{
        person
    }
}
}
</script>
<!-- css样式 -->
<style>
</style>